
//SamXIAO
#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926
#define   SQUARE(x) ((x)*(x))
//double SQUARE(double x) { return x*x;}
#define N_MAX 987654321
#define N_MIN -N_MAX
int f[286];
char s1[1086];
char s2[2020];
void w1()
{
	int cnt = 0, ans = 0, n;
	scanf("%d", &n);
	while(n--){
		scanf("%s%s", s1, s2);
		char p1, p2;
		p1 = s1[0];
		p2 = s2[0];
		if(p1 == p2)printf("Tie");
		else if('R' == p1 && 'S' == p2) printf("Player1");
		else if('R' == p1 && 'P' == p2) printf("Player2");
		else if('S' == p1 && 'R' == p2) printf("Player2");
		else if('S' == p1 && 'P' == p2) printf("Player1");
		else if('P' == p1 && 'R' == p2) printf("Player1");
		else if('P' == p1 && 'S' == p2) printf("Player2");

		printf("\n");
	}
}

int main()
{
	w1();
  return 0;
}
